import request from '@/api/request';
//获取用户项目
export function getProjectList(data) {
	return request({
		url: '/cloud360-web/pm/getUserProject',
		method: 'post',
		data,
		isForm: true
	})
}
//获取项目模块
export function getProjectModel(params) {
	return request({
		url: '/cloud360-web/pm/getProjectObjects',
		method: 'get',
		params
	})
}
// 获取项目总览
export function getProjectStat() {
	return request({
		url: '/cloud360-web/pm/overstatus',
		method: 'get',
	})
}
// 设备状态
export function getDeviceStatus(params) {
	return request({
		url: '/cloud360-web/screen/devs/status',
		method: 'get',
		params
	})
}
// 项目置顶
export function updateProjectTop(data) {
	return request({
		url: '/cloud360-web/pm/top',
		method: 'put',
		data
	})
}
// 监控数据
export function getProjectMonitor(data) {
	return request({
		url: '/cloud360-web/monitor/getMTData',
		method: 'post',
		data
	})
}
// 告警数据
export function getProjectAlarm(params) {
	return request({
		url: '/cloud360-web/monitor/getPMMTAlerts',
		method: 'get',
		params
	})
}
// 风机、灯组、门：历史数据
export function getDataHistory(data) {
	return request({
		url: '/cloud360-web/data/getDataByTUOKs',
		method: 'post',
		data
	})
}
// 获取项目模块配置列表
export function getProjectConfList(params) {
	return request({
		url: '/cloud360-web/pm/mode/conf/list',
		method: 'get',
		params
	})
}
// 更新模板配置
export function updateProjectConfig(data) {
	return request({
		url: '/cloud360-web/spiderConfig/changeRdcConf',
		method: 'post',
		data
	})
}

// 获取控制配置
export function getRdcConf(data) {
	return request({
		url: '/cloud360-web/spiderConfig/getRdcConf',
		method: 'get',
		data
	})
}

//获取设备数据
export const getDevData = (data) => {
	return request({
		method: 'POST',
		url: '/cloud360-cordata/dev/data/getDevData',
		data,
	})
}

// 回写数据
export function writeDevData(data) {
	return request({
		url: '/cloud360-cordata/dev/data/writeDevData',
		method: 'post',
		data,
		isForm: true,
	})
}

//添加点位
export function addPoint(data) {
	return request({
		url: '/cloud360-web/pm/mode/conf',
		method: 'post',
		data,
		isForm: true,
	})
}
//修改点位
export function updatePoint(data) {
	return request({
		url: '/cloud360-web/pm/mode/conf',
		method: 'put',
		data,
		isForm: true,
	})
}

//删除点位
export function deletePoint(data) {
	return request({
		url: '/cloud360-web/pm/mode/conf',
		method: 'delete',
		data,
		isForm: true,
	})
}